package cn.qinyun.cloud.common.context;

import cn.qinyun.cloud.common.entity.LoginUser;

/**
 * 类名称：UserContext <br>
 * 类描述：用户上下文 <br>
 *
 * @author 张兆发
 * @date 创建时间：2021/7/16  2:25 下午 <br>
 * @version 1.0.0
 */
public class UserContext {
    private static ThreadLocal<LoginUser> userHolder = new ThreadLocal<LoginUser>();

    public static void setUser(LoginUser loginUser) {
        userHolder.set(loginUser);
    }

    public static LoginUser getUser() {
        return userHolder.get();
    }
}
